package com.docios.cookbook2.Dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.docios.cookbook2.entity.QueryBean;

import java.util.List;

@Dao
public interface QueryBeanDao {
    @Query("SELECT * FROM queryBean")
    List<QueryBean> getAllQ();

    @Query("SELECT * FROM queryBean WHERE id = :id")
    List<QueryBean> getAllByIdQ(String id);

    @Query("SELECT * FROM queryBean WHERE name LIKE '%' || :name || '%'")
    List<QueryBean> getAllByNameQ(String name);

    @Insert
    long insertQ(QueryBean queryBean);

    @Delete
    void deleteQ(QueryBean queryBean);

    @Update
    void updateQ(QueryBean queryBean);
}
